<template>
  <el-container>
    <el-header>
      <el-row :gutter="20">
        <el-col :span="4"
          ><img
            class="logo"
            src="https://img.zcool.cn/community/010f3f5c824402a801217ce67e6b7c.jpg@1280w_1l_2o_100sh.jpg"
            alt=""
        /></el-col>
        <el-col :span="16"
          ><h2><i>Pet shop </i></h2></el-col
        >
        <el-col class="btn-text" :span="4"
          ><el-button type="text">管理员：{{ $store.state.admin.account }}</el-button>
          <el-button type="text" style="color: #f56c6c" @click="logout">退出</el-button>
        </el-col>
      </el-row>
    </el-header>
  </el-container>
</template>

<script>
export default {
  name: 'AdminHomeTop',
  methods: {
    logout() {
      window.sessionStorage.removeItem('token')
      window.localStorage.removeItem('admin')
      this.$router.push('/')
      location.reload()
    },
  },
}
</script>

<style lang="less" scoped>
.logo {
  height: 60px;
  width: 50px;
  border-radius: 30%;
}
h2 {
  text-align: center;
  height: 80px;
  line-height: 80px;
  color: #fff;
}
.btn-text {
  text-align: right;
  height: 80px;
  line-height: 80px;
}
.el-header {
  background: #545c64;
  height: 80px;
}
</style>
